<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>首页-$cmgd_config['shop_info_store_title']}</title>
    <meta name="keywords" content="$cmgd_config['shop_info_store_keyword']}"/>
    <meta name="description" content="$cmgd_config['shop_info_store_desc']}"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/alone_index.css"/>
    <script src="__STATIC__/js/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="__PUBLIC__/js/global.js"></script>
    <link rel="shortcut icon" type="image/x-icon" href="__PUBLIC__/static/images/favicon.ico" media="screen"/>
    <!-- 新浪获取ip地址 -start-->
    <if condition="$Think.cookie.province_id elt 0">
        <script src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip={$Request.ip}"></script>
        <script type="text/JavaScript">
            doCookieArea(remote_ip_info);
        </script>
    </if>
</head>
<body class="gray_f5">
    <!--header-s-->
    <div class="tpshop-tm-hander tp_h_alone p">
        <!--导航栏-s-->
        <div class="top-hander p">
            <div class="w1224 pr p">
                <div class="fl">
                    <!-- 收货地址，物流运费 -start-->
                    <link rel="stylesheet" href="__STATIC__/css/location.css" type="text/css"><!-- 收货地址，物流运费 -->
                    <div class="sendaddress pr fl">
                        <span>送货至：</span>
                        <span>
                            <ul class="list1">
                                <li class="summary-stock though-line">
                                    <div class="dd" style="border-right:0px;width:200px;">
                                        <div class="store-selector add_cj_p">
                                            <div class="text"><div></div><b></b></div>
                                            <div onclick="$(this).parent().removeClass('hover')" class="close"></div>
                                        </div>
                                    </div>
                                </li>
                            </ul>
                        </span>
                    </div>
                    <!-- 收货地址，物流运费 -end-->
                        <div class="fl nologin">
                            <a class="red" href="{:url('Home/user/login')}">Hi.请登录</a>
                            <a href="{:url('Home/user/reg')}">免费注册</a>
                        </div>
                        <div class="fl islogin">
                            <a class="red userinfo" href="{:url('Home/user/index')}" ></a>
                            <a  href="{:url('Home/user/logout')}"  title="退出" target="_self">安全退出</a>
                        </div>
                </div>
                <div class="top-ri-header fr">
                    <ul>
                        <li><a target="_blank" href="{:url('/Home/User/order_list')}">我的订单</a></li>
                        <li class="spacer"></li>
                        <li><a target="_blank" href="{:url('Home/User/visit_log')}">我的浏览</a></li>
                        <li class="spacer"></li>
                        <li><a target="_blank" href="{:url('/Home/User/coupon')}">我的优惠券</a></li>
                        <li class="spacer"></li>
                        <li><a target="_blank" href="{:url('/Home/User/goods_collect')}">我的收藏</a></li>
                        <li class="spacer"></li>
                        <li><a target="_blank" title="点击这里给我发消息" href="{:url('Home/Article/detail',array('article_id'=>22))}" target="_blank">在线客服</a></li>
                        <li class="spacer"></li>
                        <li class="hover-ba-navdh">
                            <div class="nav-dh">
                                <span>网站导航</span>
                                <i class="share-a_a1"></i>
                                <div class="conta-hv-nav">
                                    <ul>
                                        <li>
                                            <a href="{:url('Home/Activity/group_list')}">团购</a>
                                        </li>
                                        <li>
                                            <a href="{:url('Home/Activity/flash_sale_list')}">抢购</a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <!--导航栏-e-->
        <div class="nav-middan-z p">
            <div class="header w1224 p">
                <div class="ecsc-logo">
                    <a href="{:url('Index/index')}" class="logo"> <img src="$cmgd_config['shop_info_store_logo']}"></a>
                </div>
                <!--搜索-s-->
                <div class="ecsc-search">
                    <form id="searchForm" name="" method="get" action="{:url('Home/Goods/search')}" class="ecsc-search-form">
                        <input autocomplete="off" name="q" id="q" type="text" value="{$Request.param.q}" placeholder="搜索关键字" class="ecsc-search-input">
                        <button type="submit" class="ecsc-search-button" onclick="if($.trim($('#q').val()) != '') $('#searchForm').submit();"><i></i></button>
                        <div class="candidate p">
                            <ul id="search_list"></ul>
                        </div>
                        <script type="text/javascript">
                            ;(function($){
                                $.fn.extend({
                                    donetyping: function(callback,timeout){
                                        timeout = timeout || 1e3;
                                        var timeoutReference,
                                                doneTyping = function(el){
                                                    if (!timeoutReference) return;
                                                    timeoutReference = null;
                                                    callback.call(el);
                                                };
                                        return this.each(function(i,el){
                                            var $el = $(el);
                                            $el.is(':input') && $el.on('keyup keypress',function(e){
                                                if (e.type=='keyup' && e.keyCode!=8) return;
                                                if (timeoutReference) clearTimeout(timeoutReference);
                                                timeoutReference = setTimeout(function(){
                                                    doneTyping(el);
                                                }, timeout);
                                            }).on('blur',function(){
                                                doneTyping(el);
                                            });
                                        });
                                    }
                                });
                            })(jQuery);

                            $('.ecsc-search-input').donetyping(function(){
                                search_key();
                            },500).focus(function(){
                                var search_key = $.trim($('#q').val());
                                if(search_key != ''){
                                    $('.candidate').show();
                                }
                            });
                            $('.candidate').mouseleave(function(){
                                $(this).hide();
                            });

                            function searchWord(words){
                                $('#q').val(words);
                                $('#searchForm').submit();
                            }
                            function search_key(){
                                var search_key = $.trim($('#q').val());
                                if(search_key != ''){
                                    $.ajax({
                                        type:'post',
                                        dataType:'json',
                                        data: {key: search_key},
                                        url:"{:url('Home/Api/searchKey')}",
                                        success:function(data){
                                            if(data.status == 1){
                                                var html = '';
                                                $.each(data.result, function (n, value) {
                                                    html += '<li onclick="searchWord(\''+value.keywords+'\');"><div class="search-item">'+value.keywords+'</div><div class="search-count">约'+value.goods_num+'个商品</div></li>';
                                                });
                                                html += '<li class="close"><div class="search-count">关闭</div></li>';
                                                $('#search_list').empty().append(html);
                                                $('.candidate').show();
                                            }else{
                                                $('#search_list').empty();
                                            }
                                        }
                                    });
                                }
                            }
                        </script>
                    </form>
                    <div class="keyword">
                        <ul>
                            <foreach name="tpshop_config.hot_keywords" item="wd" key="k">
                                <li>
                                    <a href="{:url('Home/Goods/search',array('q'=>$wd))}" target="_blank">{$wd}</a>
                                </li>
                            </foreach>
                        </ul>
                    </div>
                </div>
                <!--搜索-e-->
                <!--购物车-s-->
                
                <div class="shopingcar-index fr">
                    <div class="u-g-cart fr fixed" id="hd-my-cart">
                        <a href="{:url('Home/Cart/cart')}">
                            <div class="c-n fl" >
                                <i class="share-shopcar-index"></i>
                                <span>我的购物车<em class="sc_z" id="cart_quantity"></em></span>
                            </div>
                        </a>
                        <div class="u-fn-cart u-mn-cart" id="show_minicart"></div>
                    </div>
                </div>
                <!--购物车-e-->
            </div>
        </div>
        <!--商品分类-s-->
        <div class="nav p">
            <div class="w1224 p">
                <div class="categorys2 home_categorys">
                    <div class="dt">
                        <a href="{:url('Home/Goods/all_category')}" target="_blank"><i class="share-a_a2"></i>全部商品分类</a>
                    </div>
                    <!--全部商品分类-s-->
                    <div class="dd">
                        <div class="cata-nav">
                            <!-- 外层循环点-->
                            <foreach name="goods_category_tree" key="k" item='v'>
                            <div class="item fore1">
                                <if condition="$v['level'] eq 1">
                                <div class="item-left">
                                    <div class="cata-nav-name">
                                        <h3>
                                            <div class="contiw-cer"><span class="share-icon-{$k}"></span></div>
                                            <a href="{:url('Home/Goods/goodsList',array('id'=>$v['id']))}" title="{$v['name']}">{$v['name']}</a>
                                        </h3>
                                    </div>
                                    <b>&gt;</b>
                                </div>
                                </if>
                                <div class="cata-nav-layer">
                                    <div class="cata-nav-left">
                                        <div class="subitems">
                                            <foreach name="v['tmenu']" key="k2" item='v2'>
                                                <if condition="$v2['parent_id'] eq $v['id']">
                                                <dl><!-- 2级循环点-->
                                                    <dt>
                                                        <a href="{:url('Home/Goods/goodsList',array('id'=>$v2['id']))}" target="_blank">{$v2['name']}<i>&gt;</i></a>
                                                    </dt>
                                                    <dd>
                                                        <foreach name="v2['sub_menu']" key="k3" item='v3'>
                                                            <if condition="$v3['parent_id'] eq $v2['id']">
                                                            <a href="{:url('Home/Goods/goodsList',array('id'=>$v3['id']))}" target="_blank">{$v3['name']}</a></if>
                                                        </foreach>
                                                    </dd>
                                                </dl>
                                                </if>
                                            </foreach>
                                            <!--商品分类底部广告-s-->
                                            <div class="advertisement_down">
                                                <ul>                                                
                                                    <adv pid="14" item="v3" limit="1">
                                                        <li>
                                                            <a href="{$v3['ad_link']}" <if condition="$v3['target'] eq 1">target="_blank"</if>>
                                                                <img src="{$v3['ad_code']}" title="{$v3['title']}" style="{$v3['style']}" width="129" height="45"/>
                                                            </a>
                                                        </li>
                                                    </adv>                                                
                                                </ul>
                                            </div>
                                            <!--商品分类底部广告-e-->
                                        </div>
                                    </div>
                                    <!--商品分类右侧广告-s-->
                                    <div class="cata-nav-rigth">
                                        <adv item="v" pid="51" limit="1">
                                            <a href="{$v['ad_link']}"  <if condition="$v['target'] eq 1">target="_blank"</if>>
                                                <img src="{$v['ad_code']}" title="{$v['title']}" style="{$v['style']}"/>
                                            </a>
                                        </adv>
                                    </div>
                                    <!--商品分类右侧广告-e-->
                                </div>
                            </div>
                            </foreach>
                        </div>
                    </div>
                    <!--全部商品分类-e-->
                </div>
                <!--导航栏-s-->
                 <div class="navitems" id="nav">
                    <ul>
                        <li class="index_modify">
                            <a href="{:url('Index/index')}" class="selected">首页</a>
                        </li>
                        <tpshop sql="SELECT * FROM `__PREFIX__navigation` where is_show = 1 ORDER BY `sort` DESC" key="k" item='v'>
                            <li class="page"><a href="{$v[url]}" <if condition="$v[is_new] eq 1">target="_blank" </if><span>{$v[name]}</span></a></li>
                        </tpshop>
                    </ul>
                    <!-- <div class="wrap-line" style="width: 72px; left: 20px;">
                        <span style="left:15px;"></span>
                    </div> -->
                </div>
                <!--导航栏-e-->
            </div>
        </div>
        <!--商品分类-e-->
    </div>
    <!--header-e-->
    <!--轮播图-s-->
    <div id="myCarousel" class="carousel slide p header-tp" data-ride="carousel">
        <ol class="carousel-indicators">

        </ol>
        <div class="carousel-inner">
        	<assign name="adk" value="1" />
            <adv pid="2" item="v1" limit="5">
                <div class="item <if condition='$adk++ eq 1'>active</if>" style="background:{$v.bgcolor};">
                    <a href="{$v1[ad_link]}"  <if condition="$v1['target'] eq 1">target="_blank"</if>>
                        <img  src="{$v1[ad_code]}" title="{$v1[title]}" style="{$v1[style]}">
                    </a>
                </div>
            </adv>
        </div>
        <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
        <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
        <!--轮播图右侧广告-s-->
        <div class="adcertiserment_head">
            <div class="w1224">
                <ul>
                    <adv pid="52" item="v" limit="2">
                        <li>
                            <a href="{$v[ad_link]}" <if condition="$v['target'] eq 1">target="_blank"</if>>
                            <img src="{$v[ad_code]}" title="{$v[title]}" style="{$v[style]}"/>
                            </a>
                        </li>
                    </adv>
                </ul>
            </div>
        </div>
        <!--轮播图右侧广告-e-->
    </div>
    <!--轮播图-e-->
    <!--轮播图底部广告-s-->
    <div class="adv3 p">
        <div class="w1224">
            <ul>
                <adv pid="53" item="v" limit="3">
                    <li>
                        <a href="{$v[ad_link]}" <if condition="$v['target'] eq 1">target="_blank"</if>>
                            <img src="{$v[ad_code]}" title="{$v[title]}" style="{$v[style]}"/>
                        </a>
                    </li>
                </adv>
            </ul>
        </div>
    </div>
    <!--轮播图底部广告-e-->
    <div class="adver_line">
        <div class="w1224">
            <adv  pid = "3" limit="1" item="v">
                <a href="{$v['ad_link']}" <if condition="$v['target'] eq 1">target="_blank"</if>>
                <img src="{$v['ad_code']}" width="1200" height="160"  title="{$v[title]}" style="{$v[style]}"/>
                </a>
            </adv>
        </div>
    </div>

<!--------楼层-开始-------------->
    <foreach name="cateList" item="v" key="k">
    <!--商品楼层-s-->
        <div class="layer-floor " id="floor{$k+1}">
            <div class="w1224">
            <div class="top_title_layer p">
                <div class="part-title">{$v[name]}</div>
                <div class="part-hot">
                    <ul>
                        <foreach name="v[tmenu]" item="v2" key="k2">
                            <li>
                                <a href="{:url('Home/Goods/goodsList',array('id'=>$v2[id]))}">{$v2[name]}</a>
                            </li>
                        </foreach>
                    </ul>
                </div>
            </div>
            <div class="main_layer p">
                <div class="hoste_le">  
					<?php $adk_arr = $v['id']+10; ?>                   
                    <adv  pid="$adk_arr" limit="1" item="v2">
                        <a class="big_adve" href="{$v2['ad_link']}" <if condition="$v2['target'] eq 1">target="_blank"</if>>
                        <img src="{$v2['ad_code']}" width="232" height="571"  title="{$v2[title]}" style="{$v2[style]}"/>
                        </a>
                    </adv>                    
                </div>
                <div class="hoste_ri">
                    <ul>
                        <foreach name="v[hot_goods]" item="g" key="gk">
                            <if condition="$gk lt 8">
                                <li>
                                    <a href="{:url('Home/Goods/goodsInfo',array('id'=>$g[goods_id]))}">
                                        <img class="picture_main" src="{$g[goods_id]|goods_thum_images=200,200}"/>
                                        <span class="name_main">{$g[goods_name]|getSubstr=0,15}</span>
                                        <!--<span class="intro_main">{$g[name]}</span>-->
                                        <span class="price_main"><i>￥</i>{$g[shop_price]}</span>
                                    </a>
                                </li>
                            </if>
                        </foreach>
                    </ul>
                </div>
            </div>
        </div>
        </div>
    <!--商品楼层-e-->
    </foreach>
    <!--楼层导航-s-->
    <div class="floornav_left">
        <ul>
            <foreach name="cateList" item="v" key="k">
                <li class="elevators">
                    <a >{$k+1}F<span class="cofin_floor">{$v['mobile_name']}</span></a>
                </li>
            </foreach>
        </ul>
    </div>
    <!--楼层导航-e-->
<!--------楼层-结束-------------->

    <!--footer-s-->
    <div class="foot-alone tp_h_alone">
        <div class="foot-banner">
            <div class="w1224">
                <div class="sum_baner">
                    <div class="baner-item">
                        <a href="">
                            <i class="icon1">7</i>
                            7天无理由退货
                        </a>
                    </div>
                    <div class="baner-item">
                        <a href="">
                            <i class="icon1">15</i>
                            15天免费换货
                        </a>
                    </div>
                    <div class="baner-item">
                        <a href="">
                            <i class="icon1">99</i>
                            满99元包邮
                        </a>
                    </div>
                    <div class="baner-item">
                        <a href="">
                            <i class="icon1">服</i>
                            手机特色服务
                        </a>
                    </div>
                </div>
            </div>
        </div>
        <div class="foot-main">
            <div class="w1224">
                <div class="sum_main">
                    <tpshop sql="select * from `__PREFIX__article_cat` where parent_id = 2" key="k" item='v'>
                        <dl class="foot-con">
                            <dt>{$v[cat_name]}</dt>
                            <tpshop sql="select * from `__PREFIX__article` where cat_id = $v[cat_id]  and is_open=1" key="k2" item='v2'>
                            <dd>
                                <a target="_blank" href="{:url('Home/Article/detail',array('article_id'=>$v2[article_id]))}">{$v2[title]}</a>
                            </dd>
                            </tpshop>
                        </dl>
                    </tpshop>
                    <dl class="foot-con continue">
                        <dt>联系我们</dt>
                        <dd>
                            <span class="cellphone_con">$cmgd_config['shop_info_phone']}</span>
                            <span class="time_con">周一至周日8:00-18:00</span>
                            <span class="cost_con">（仅收市话费）</span>
                            <a class="software_con" href="tencent://message/?uin=$cmgd_config['shop_info_qq2']}&amp;Site=TPshop商城&amp;Menu=yes" target="_blank">
                                <img src="__STATIC__/images/continue.png"/>
                            </a>
                        </dd>
                    </dl>
                </div>
            </div>
        </div>
        <div class="foot-bottom">
            <p>Copyright © 2016-2025 $cmgd_config['shop_info_store_name']|default='TPshop商城'} 版权所有 保留一切权利 备案号:$cmgd_config['shop_info_record_no']}</p>
        </div>
    </div>
    <!--侧边栏-s-->
    <div class="tp_h_alone">
        <div class="slidebar_alo">
            <ul>
                <li class="re_cuso"><a title="点击这里给我发消息" href="tencent://message/?uin=$cmgd_config['shop_info_qq2']}&amp;Site=TPshop商城&amp;Menu=yes" target="_blank">客服服务</a></li>
                <li class="re_wechat">
                    <a target="_blank" href="" >微信关注</a>
                    <div class="rtipscont" style="">
                        <span class="arrowr-bg"></span>
                        <span class="arrowr"></span>
                        <img src="__STATIC__/images/qrcode.png" />
                        <p class="tiptext">扫码关注官方微信<br>先人一步知晓促销活动</p>
                    </div>
                </li>
                <li class="re_phone">
                    <a target="_blank" href="{:url('Mobile/Index/index')}" >手机商城</a>
                    <div class="rtipscont rstoretips" style="">
                        <span class="arrowr-bg"></span>
                        <span class="arrowr"></span>
                        <img src="__STATIC__/images/qrcode.png" />
                        <p class="tiptext">扫码关注官方微信<br>先人一步知晓促销活动</p>
                    </div>
                </li>
                <li class="re_top"><a target="_blank" href="javascript:void(0);" >回到顶部</a></li>
            </ul>
        </div>
    </div>
    <!--侧边栏-e-->
    <!--footer-e-->
    <script src="__STATIC__/js/common.js" type="text/javascript" charset="utf-8"></script>
    <script src="__STATIC__/js/carousel.js" type="text/javascript" charset="utf-8"></script>
    <script src="__STATIC__/js/transition.js" type="text/javascript" charset="utf-8"></script>
    <script src="__STATIC__/js/headerfooter_alone.js" type="text/javascript" charset="utf-8"></script>
    <!--------收货地址，物流运费-开始-------------->
    <script src="__STATIC__/js/location.js"></script>
    <!--------收货地址，物流运费--结束-------------->
    <script type="text/javascript">
        $(function() {
            //首页商品分类显示
            $('.categorys2 .dd').show();

                var uname= getCookie('uname');
                if(uname == ''){
                    $('.islogin').hide();
                    $('.nologin').show();
                }else{
                    $('.nologin').hide();
                    $('.islogin').show();
                    //获取用户名
                    $('.userinfo').html(decodeURIComponent(uname));
                }
        })
        $(function() { //轮播自动播放
            $(".carousel").carousel({interval: 2000});
        });
        $(function() { //floor分类鼠标滑动
            $(".f_tab li").each(function() {
                $(this).hoverDelay({
                    hoverEvent: function() {
                        $(this).addClass('ft');
                        $(this).siblings().removeClass('ft');
                    },
//			    		outEvent: function(){
//			        		$(this).siblings().removeClass('ft'); 
//			    		}
                });
            })
        });
        /**
         * 鼠标移动端到头部购物车上面 就ajax 加载
         */
        // 鼠标是否移动到了上方
        var header_cart_list_over = 0;
        $("#hd-my-cart > .c-n").hover(function(){
            if(header_cart_list_over == 1)
                return false;
            header_cart_list_over = 1;
            $.ajax({
                type : "GET",
                url:"/index.php?m=Home&c=Cart&a=header_cart_list",//+tab,
                success: function(data){
                    $("#show_minicart").html(data);
                }
            });
        }).mouseout(function(){

            (typeof(t) == "undefined") || clearTimeout(t);
            t = setTimeout(function () {
                header_cart_list_over = 0; /// 标识鼠标已经离开
            }, 1000);
        });
    //楼层按钮
        //楼层添加data-mid
    $(function(){
        var Dum = {};
        Dum.brand = {
            i:0,
            ri:function(e){
                $(e).each(function(){
                    $(this).attr('id','brand_' + Dum.brand.i);
                    Dum.brand.i++
                })
                Dum.brand.i = 0;
                return Dum.brand.i;
            },
        }
        Dum.brand.ri(".layer-floor");
    })
    //侧边导航
    $(function(){
        $(window).scroll(function(){
            var main_brand = $('.adv3').offset().top;
            var scr = $(document).scrollTop();
            if(scr >= main_brand){
                $('.floornav_left').addClass('showfloornav');
            }else{
                $('.floornav_left').removeClass('showfloornav');
            }
        })

        var _index=0;
        var scr = $(document).scrollTop();
        $(".floornav_left ul li").click(function(){
            _index=$(this).index();
            //通过拼接字符串获取元素，再取得相对于文档的高度
            var _top=$("#brand_"+_index).offset().top + 1;//Firefox有1px的误差
            //scrollTop滚动到对应高度
            $("body,html").animate({scrollTop:_top},500);
        });
        $(window).scroll(function(){
            var tj = [];
            var strlength = $('.layer-floor').length;
            var stheigh = $('.layer-floor').eq(strlength - 1).height();//最后一个楼层的高度
            var scr = $(document).scrollTop();
            $('.layer-floor').each(function(i){
                var sthei = $(this).offset().top;
                tj.push(sthei);//楼层距离顶部的高度添加进数组
            })
            for(var n = 0;n < strlength;n++){
                if(scr >= tj[n] && scr <= tj[n] + stheigh){
                    $(".floornav_left ul li").eq(n).addClass("darkshow").siblings().removeClass("darkshow");
                }
            }
        });
    })
    </script>
</body>
</html>
